package org.shj.algorithm.dhsjjg.mintree;

public class Graph {

	//用最大值来表示两个点之间没有连线
	private static int INFINITY = Integer.MAX_VALUE; 
		
	//网络图中顶点的集合, 假设有9个点
	private String[] dots = new String[]{"V0", "V1", "V2",
										 "V3", "V4", "V5",
										 "V6", "V7", "V8"};
	
	//网络图中，任意两个点之间距离的集合。此数组表示：
	// arc[i][j]的值表示点dots[i]与点dots[j]连线的权值，可理解为两点的距离， INFINITY表示两点没有连线
	private int[][] arc = new int[][]{
		//   V0        V1        V2        V3        V4        V5        V6        V7        V8
			{0,        10,       INFINITY, INFINITY, INFINITY, 11,       INFINITY, INFINITY, INFINITY}, //V0
			{10,       0,        18,       INFINITY, INFINITY, INFINITY, 16,       INFINITY, 12},       //V1
			{INFINITY, 18,       0,        22,       INFINITY, INFINITY, INFINITY, INFINITY, 8},        //V2
			{INFINITY, INFINITY, 22,       0,        20,       INFINITY, INFINITY, 16,       21},       //V3
			{INFINITY, INFINITY, INFINITY, 20,       0,        26,       INFINITY, 7,        INFINITY}, //V4
			{11,       INFINITY, INFINITY, INFINITY, 26,       0,        17,       INFINITY, INFINITY}, //V5
			{INFINITY, 16,       INFINITY, INFINITY, INFINITY, 17,       0,        19,       INFINITY}, //V6
			{INFINITY, INFINITY, INFINITY, 16,       7,        INFINITY, 19,       0,        INFINITY}, //V7
			{INFINITY, 12,       8,        21,       INFINITY, INFINITY, INFINITY, INFINITY, 0}         //V8
	};

	public String[] getDots() {
		return dots;
	}

	public void setDots(String[] dots) {
		this.dots = dots;
	}

	public int[][] getArc() {
		return arc;
	}

	public void setArc(int[][] arc) {
		this.arc = arc;
	}		
}
